#ifndef TNW_MOV_XY_H
#define TNW_MOV_XY_H 1

#ifdef ALONE_TNW_MOV_XY
#include <stdio.h>
#include <math.h>
#include "ApmsApi.h"
#include "Tianwan.h"
#include "Uti_Tianwan.h"
#include "Mov_Tianwan.h"
#include "Twn_Exec_Mov.h"
#include "Twn_Path_Fill.h"
#define APIMOVXY extern "C" __declspec(dllexport)
#else
#define APIMOVXY extern "C" __declspec(dllimport)
#endif

int		MXY_Err;
TCHAR	MXY_LogMsg[128];
TCHAR	MXY_LogPath[128];
BOOL	MXY_LogActive;

#define	MY_BUFSIZE	80

#define MXY_ERR_CODE(ErrCode)	ErrCode + 1000
#define TUNE_DIST			1000

APIMOVXY PHASTAT Mov_xy_Exec (GENIDX StaZoneIdx,float X_Act, float X_Nex, float Y_Act, float Y_Nex);
APIMOVXY PHASTAT Mov_xy_Exec_Check (GENIDX StaZoneIdx, float *X_Act, float *X_Nex, 
								    float *Y_Act, float *Y_Nex, int Path_Type, OBJTMM *ObjtMast );
APIMOVXY PHASTAT Mov_xy_local(int S_Virt_X, int S_Virt_Y, int D_Virt_X, int D_Virt_Y,
							  float S_Phis_X, float S_Phis_Y, float D_Phis_X, float D_Phis_Y, 
							  float TV_Angle_S, float TV_Angle_D);
APIMOVXY PHASTAT Mov_xy(int S_Virt_X, int S_Virt_Y, int D_Virt_X, int D_Virt_Y,
						float S_Phis_X, float S_Phis_Y, float D_Phis_X, float D_Phis_Y,
						float TV_Angle_D);
APIMOVXY PHASTAT CheckMoveFeasibility(float sx, float sy, float dx, float dy, float *cx, float *cy);
APIMOVXY PHASTAT CheckMoveFeasibilityEx(float sx, float sy, float dx, float dy, float tvAngle, float *cx, float *cy);
APIMOVXY int MXY_LogFileWrite(TCHAR cmd[4], TCHAR *Comment, int errNum);
APIMOVXY int MXY_ActivateLog(void);
APIMOVXY int MXY_DeactivateLog(void);
APIMOVXY int MXY_SetLogPath(TCHAR *path);
APIMOVXY BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved);
#endif